//
//  MZDecimalDemoModel.h
//  MZBaseDemo
//
//  Created by Chris Yang on 2016/12/6.
//  Copyright © 2016年 Chris Yang. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, MZDemoOpType) {
    
    MZDemoOpTypeUnknown = -1,
    
    MZDemoOpTypeAdd,
    MZDemoOpTypeSub,
    MZDemoOpTypeMul,
    MZDemoOpTypeDiv,
};

@class MZDecimalDemoModel;

@protocol MZDecimalDemoModelDelegate <NSObject>

- (void)demoModel:(MZDecimalDemoModel *)model didUpdateOpType:(MZDemoOpType)opType;

@end

@interface MZDecimalDemoModel : NSObject

@property (nonatomic, weak) id<MZDecimalDemoModelDelegate>delegate;

@property (nonatomic) MZDemoOpType curOpType;

- (NSString *)typeStrOfType:(MZDemoOpType)opType;

/* View Support */
- (UIAlertController *)opTypeSettingActionSheet;

/* Calculate */
- (NSString *)decimalCalcWithLeftStr:(NSString *)leftStr rightStr:(NSString *)rightStr;
- (NSString *)stringCalcWithLeftStr:(NSString *)leftStr rightStr:(NSString *)rightStr;
- (NSString *)numberCalcWithLeftStr:(NSString *)leftStr rightStr:(NSString *)rightStr;

/* Rounding */
- (NSString *)roundingStrFromValString:(NSString *)valStr scale:(NSInteger)scale;


@end
